Skip to content

Conversation

shoyer
Copy link
Member

@shoyer shoyer commented Sep 25, 2025

Copy link
Collaborator

@mathause mathause left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking forward to this! Should the path of the node be added to the error message if the merge fails?

tree1 = xr.DataTree.from_dict({"/a/b": 1})
tree2 = xr.DataTree.from_dict({"/a/b": 2})
xr.merge([tree1, tree2])

e.g. using

def _handle_errors_with_path_context(path: str):

@veni-vidi-vici-dormivi FYI

@shoyer
Copy link
Member Author

shoyer commented Sep 26, 2025

Looking forward to this! Should the path of the node be added to the error message if the merge fails?

Great suggestion, done!

@github-actions github-actions bot added the topic-DataTree Related to the implementation of a DataTree class label Sep 26, 2025
Copy link
Collaborator

@mathause mathause left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! With this we can replace our custom datatree-merge function (which uses map_over_datasets) - I just checked and our tests still pass.

@shoyer
Copy link
Member Author

shoyer commented Oct 6, 2025

Nice! With this we can replace our custom datatree-merge function (which uses map_over_datasets) - I just checked and our tests still pass.

Thanks for checking! Let me know if you have any suggestions for further test coverage.

@shoyer shoyer added the plan to merge Final call for comments label Oct 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plan to merge Final call for comments topic-DataTree Related to the implementation of a DataTree class
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support DataTree in xarray.merge
2 participants